Repository navigation
Answer permission and plan cards with y / n / a, even from the composer - #1670
Conversation
…nd prefix, not all of Bash (#477) While a tool permission or plan card is pending, y accepts/approves, n denies/keeps planning, a always-allows. Pending permission outranks typing: the keys are taken from a focused composer (capture phase, never typed). The card's own fields keep their keys, and guardrail-flagged cards never take keys from the composer. Allow-always on a Claude shell command now adds a session rule for the command prefix (npm test:*), editable on the card, instead of the whole tool. "Allow any Bash" stays as an explicit button with no key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 66ee251e9f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (decision === "allowAlways" && !governed) { | ||
| // Unedited: whole-tool session rule (matches today's Accept all). | ||
| // Edited: prefix of the *edited* command, never the original (#509). | ||
| // Command prefix (or the user's glob), not the whole tool (#477). | ||
| response.updatedPermissions = [ | ||
| sessionAllowRule(pending.toolName, resolved.next, { | ||
| edited: resolved.edited, | ||
| }), | ||
| sessionAllowRule( | ||
| pending.toolName, | ||
| resolved.field ? resolved.next : null, | ||
| input.alwaysRule, |
There was a problem hiding this comment.
Apply the displayed rule to governed session grants
When a thread has an agent profile with rules and the current call is not covered by profile.ask, the card still offers an editable prefix such as npm test:* (and even “allow any Bash”), but this !governed branch skips alwaysRule entirely; the preceding logic stores only recheck.actionHash, which includes the complete command (electron/governance.js:236-243). Consequently, approving npm test:* only suppresses the identical command and another command under that prefix prompts again. Either implement prefix matching within governed session grants while retaining policy precedence, or avoid presenting the prefix/whole-tool choices in this context.
Useful? React with 👍 / 👎.
… n / a on top #1666 landed #479 on main with the same shape as this branch's narrowing (alwaysRule, "*" for the whole tool). Take main's backend, IPC and card UI as-is; this branch now only adds the keyboard layer (#477): y / n / a on permission and plan cards, key hints, the composer marker, and tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Closes #477. Permission and plan cards now answer from the keyboard, like the CLIs:
yaccepts or approves the plan,ndenies or keeps planning, andaalways-allows. Theakey uses #1666's prefix rule (npm test:*, or whatever you typed in the rule field), not the whole tool.Changes
ymid-sentence can't approve something the guardrail called risky.yAccept ·aAlways allownpm test:*·nDeny;yApprove plan ·nKeep planning), plusaria-keyshortcuts.site/docs.htmldocuments the keys and the "outranks typing" rule.Verification
tsc --noEmitandvite buildpass.y/n/afrom a focused composer with the keydown never reaching it,asending an edited rule, fields that keep their keys, guardrail cards ignoring the composer, Cmd+A passing through, and the hints on the buttons.electron/.Notes for reviewers
aalways-allows the prefix rule. Taking keys only from an empty composer is a one-line change if you'd rather.a(append) in the composer is used by the card instead.claude-opus-5-5 via Claude Code
🤖 Generated with Claude Code